package com.example.springtask.bean;

import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;

@Component
public class DataCleaningTask implements CommandLineRunner {
    @Override
    public void run(String... args) throws Exception {
      /*  if (args.length != 1) {
            throw new IllegalArgumentException("File path must be specified");
        }

        String filePath = args[0];

        try (BufferedReader br = new BufferedReader(new FileReader(filePath))) {
            String line;
            while ((line = br.readLine()) != null) {
                String cleanedLine = StringUtils.trimAllWhitespace(line.replaceAll("\\d", ""));
                System.out.println(cleanedLine);
            }
        } catch (IOException e) {
            throw new RuntimeException(e);
        }*/
        System.out.println("DataCleaningTask");
    }
}